<template>
	<view class="content">
		<navBar>
			<template @click="backPage()" slot="left">
				<u-icon name="arrow-left" color="#fff"></u-icon>
			</template>
			<template class="centerText" slot="center">
				<view class="" style="color: #fff">{{formData.goods_name}}</view>
			</template>
		</navBar>
		<view class="information_entry">
			<!-- <u-read-more  :showHeight="200" ref="uReadMore"  @load="load" > -->
			<u--form labelPosition="left" ref="uForm" labelWidth="80" :model="formData">
				<u-form-item label="物料名称" borderBottom ref="item1">
					<u--input v-model="formData.goods_name" disabled disabledColor="#ffffff" border="none"></u--input>
				</u-form-item>
				<u-form-item label="物料图片" borderBottom ref="item1">
					<u-upload :deletable='false' :fileList="fileList1" name="1" multiple :maxCount="1">
						<template>
							<view class="upload_box">+</view>
						</template>
					</u-upload>
				</u-form-item>
				<u-form-item label="物料编号" borderBottom ref="item1">
					<u--input v-model="formData.goods_no" disabled disabledColor="#ffffff" border="none"></u--input>
				</u-form-item>
				<u-form-item label="物料品牌" borderBottom ref="item1">
					<u--input v-model="formData.brand_name" disabled disabledColor="#ffffff" border="none"></u--input>
				</u-form-item>
				<u-form-item label="物料分类" borderBottom ref="item1">
					<u--input v-model="formData.cate_name" disabled disabledColor="#ffffff" border="none"></u--input>
				</u-form-item>
				<u-form-item label="物料单位" borderBottom ref="item1">
					<u--input v-model="formData.unit" disabled disabledColor="#ffffff" border="none"></u--input>
				</u-form-item>
				<u-form-item label="创建时间" borderBottom ref="item1">
					<u--input v-model="formData.create_time" disabled disabledColor="#ffffff" border="none"></u--input>
				</u-form-item>
			</u--form>
			<!-- </u-read-more> -->
		</view>
	</view>
</template>

<script>
	import navBar from '@/components/navBar.vue'
	export default {
		data() {
			return {
				formData: '',
				fileList1: [],
				defaultImg: '/static/images/shixiao.png',
			};
		},
		components: {
			navBar
		},
		onLoad(e) {
			if (e.info) {
				this.formData = JSON.parse(e.info)
				if (this.formData.goods_img != '') {
					this.fileList1.push({
						url: this.formData.goods_img
					})
				} else {
					this.fileList1.push({
						url: this.defaultImg
					})
				}

			}
		},
		methods: {
			backPage() {
				uni.navigateBack();
			},
		}
	}
</script>

<style lang="scss">
	.content {
		background-color: #f3f4f6;
		height: 100vh;
		padding-bottom: 20rpx;
		box-sizing: border-box;

		.information_entry {
			background-color: #fff;
			margin: 10rpx;
			padding: 30rpx 20rpx;
			border-radius: 20rpx;

			::v-deep .u-form-item__body__left {
				margin-left: 20rpx;
			}

			::v-deep .u-upload__wrap__preview {
				width: 110rpx;
				height: 110rpx;
			}

			::v-deep .u-upload__wrap__preview__image {
				width: 110rpx !important;
				height: 110rpx !important;
			}
		}
	}
</style>